package com.zmn.oms.persistence.interfaces.part;

import com.zmn.oms.model.entity.part.OrderPart;
import com.zmn.oms.model.entity.part.OrderPartQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderPartDao {

	List<OrderPart> listByQuery(OrderPartQuery query);

	/**
	 * 根据订单Id集合查询
	 * @param orderIdList
	 * @return
	 */
	List<OrderPart> listEsOrderPartByOrderIdList(@Param("orderIdList") List<Long> orderIdList);

	/**
	 * 根据订单id和报销id查询配件列表
	 * @param orderId
	 * @param reimburseId
	 * @return java.util.List<com.zmn.oms.model.entity.part.OrderPart>
	 * @author wangxiaokun
	 */
	List<OrderPart> listByOrderIdAndReimburseId(@Param("orderId") Long orderId,
												@Param("reimburseId") String reimburseId);

	int insertAll(@Param("partList") List<OrderPart> partList);

	int deleteByOrderId(Long orderId);

	int deleteByOrderIdAndPartType(OrderPart record);

	int deleteByOrderIdAndReimburseId(@Param("orderId") Long orderId, @Param("reimburseId") String reimburseId);

	/**
	 * 根据【报销单号】更新报销状态
	 *
	 * @param orderId         订单号
	 * @param reimburseId     报销单号
	 * @param reimburseStatus 报销状态
	 * @return
	 * @author liudi
	 * @since: 2022/3/11 11:23
	 */
	int updateReimburseStatusByReimburseId(@Param("orderId") Long orderId,
	                                       @Param("reimburseId")String reimburseId,
	                                       @Param("reimburseStatus")Integer reimburseStatus);

	int updateByOrderPartByOrderPartId(OrderPart list);

	int updateSettlementSubjectTypeByOrderPartId(OrderPart orderPart);

	int updateAiStatusByOrderPartId(OrderPart orderPart);
}